﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
using UnityTemplate.Repository;

namespace UnityTemplate.ApiModel.Models
{
    /// <summary>
    /// 用户信息
    /// </summary>
    public class UserInfos
    {
        public long Id { get; set; }
        /// <summary>
        /// 用户所属部门ID
        /// </summary>
        [Display(Name = "用户所属部门ID")]
        [Required]
        public long DepartId { get; set; }
        /// <summary>
        /// 用户姓名
        /// </summary>
        [Display(Name = "用户姓名")]
        [StringLength(32, ErrorMessage = "{0}最多{1}个字符")]
        [Required]
        public string UserName { get; set; }
        /// <summary>
        /// 登录账户名
        /// </summary>
        [Display(Name = "登录账户")]
        [StringLength(32, ErrorMessage = "{0}最多{1}个字符")]
        [Required]
        public string Account { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public Sex Sex { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [Phone]
        [StringLength(11, ErrorMessage = "{0}最多{1}位")]
        public string MobilePhone { get; set; }

        /// <summary>
        /// 注册邮箱
        /// </summary>
        [EmailAddress]
        [Required]
        public string Email { get; set; }

        /// <summary>
        /// 用户密码
        /// </summary>
        [JsonIgnore]
        public string Password { get; set; }
    }
}
